package com.todo.ln.controller;

import com.todo.ln.entity.Admin;
import com.todo.ln.service.AdminService;
import com.todo.ln.utils.RestUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 1.@description:
 * 2.@author:ln
 * 3.@Date:2022/9/15
 */
@Controller
public class LoginController {
    @Autowired
    private AdminService adminService;
    @RequestMapping("/login")
    @ResponseBody  // 表示以字符串返回数据
    public RestUtils Login(Admin admin){
        return adminService.login(admin.getUsername(),admin.getPassword());
    }

}
